package com.imooc.sell.VO.wang.OutParamVO;


import com.imooc.sell.utils.wang.DateFormatUtils;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class OrderOutVO {
    /**
     * 订单号
     */
    private String orderId;

    /**
     * 订单总价
     */
    private BigDecimal orderAmount;

    /**
     * 订单状态
     */
    private short orderStatus;

    /**
     * 支付状态
     */
    private short payStatus;

    /**
     * 订单地址
     */
    private String address;

    /**
     * 订单创建时间
     */
    private String createTime;


    public OrderOutVO(String orderId, BigDecimal orderAmount, short orderStatus, short payStatus, String address, Date createTime) {
        this.orderId = orderId;
        this.orderAmount = orderAmount;
        this.orderStatus = orderStatus;
        this.address = address;
        this.createTime = DateFormatUtils.format("yyyy-MM-dd HH:mm:ss", createTime);
        this.payStatus = payStatus;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = DateFormatUtils.format("yyyy-MM-dd HH:mm:ss", createTime);
    }
}
